All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.image.QTImageProducer

java.lang.Object
   |
   +----quicktime.app.image.QTImageProducer

public class QTImageProducer
extends Object
implements ImageProducer, Redrawable
The QTImageProducer implements the java.awt.image.ImageProducer interface for a single source QuickTime object. The QuickTime source can be a single frame (ie. still image) or a mutliple frame source such as a movie, sprite world animation, effect, etc. The QTImageProducer can produce images for multiple ImageConsumers.

The isRedrawing() method returns true if the source QT object is an object that requires redrawing. In this case the ImageObserver of this Producer should explicitly call the redraw() method and repaint the resultant Image to see any changes in the source of the pixel data. For instance a typical movie will be a sequence of images over time, and for consequent frames to be seen the producer must be redraw. The act of redrawing the producer will also result in the registered consumers being notified and given the changed pixels. Redrawing can also be optimised to only redraw those pixels within a specified region.

When the source is originally added to the Producer it is drawn. If the source is not or does not require redrawing then consequent calls to redraw will have no effect as the source pixels have not changed. If the redrawing characteristics of the QTDrawable source change then you must call setRedrawing(true) to tell the producer that it should redraw the source's pixel data before the redraw method is called. By default an QTImageProduce is seen as potentially presenting dynamic or changing image data.


Constructor Index

 o QTImageProducer(QTDrawable, Dimension)
Creates an ImageProducer from the specified qtSource.

Method Index

 o addConsumer(ImageConsumer)
This method is used to register an ImageConsumer with the ImageProducer for access to the image data during a later reconstruction of the Image.
 o getSize()
This returns the rendered size of the qtSource pixel data as specified in the constructor.
 o isConsumer(ImageConsumer)
This method determines if a given ImageConsumer object is currently registered with this ImageProducer as one of its consumers.
 o isRedrawing()
Returns true if the image data may be altered or different upon different calls of the redraw method of the QTDrawable interface
 o isSingleFrame()
Returns true if the Redrawable only has a single frame to render and thus will never need to re-acquire or redraw its image.
 o redraw(Region)
This method is called to redraw the QuickTime image source and update any of the current ImageConsumers with the new pixels that have been generated.
 o removeConsumer(ImageConsumer)
This method removes the given ImageConsumer object from the list of consumers currently registered to receive image data.
 o requestTopDownLeftRightResend(ImageConsumer)
This method is used by an ImageConsumer to request that the ImageProducer attempt to resend the image data one more time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in order can be used to produce a better output version of the image.
 o setRedrawing(boolean)
If true then the redraw method of the object will fetch new image data from its image source.
 o startProduction(ImageConsumer)
This method both registers the given ImageConsumer object as a consumer and starts an immediate reconstruction of the image data which will then be delivered to this consumer and any other consumer which may have already been registered with the producer.
 o updateConsumers(Region)
This method can be called by an application to have the QTImageProducer to update the pixel data for each of the registered ImageConsumers when the source QTDrawable object has drawn.

Constructors

 o QTImageProducer
 public QTImageProducer(QTDrawable qtSource,
                        Dimension initSize) throws QTException
Creates an ImageProducer from the specified qtSource. The initialSize of the qtSource should be specified to get the best pixel resolution of the source material.

Parameters:
qtSource - the source of pixel data for the ImageProducer.
initSize - the intial size of the source data

Methods

 o isSingleFrame
 public boolean isSingleFrame()
Returns true if the Redrawable only has a single frame to render and thus will never need to re-acquire or redraw its image. Certain Redrawable objects are able to optimise their resources knowing this constraint.

 o addConsumer
 public synchronized void addConsumer(ImageConsumer ic)
This method is used to register an ImageConsumer with the ImageProducer for access to the image data during a later reconstruction of the Image. The ImageProducer may, at its discretion, start delivering the image data to the consumer using the ImageConsumer interface immediately, or when the next available image reconstruction is triggered by a call to the startProduction method.

See Also:
startProduction
 o isConsumer
 public synchronized boolean isConsumer(ImageConsumer ic)
This method determines if a given ImageConsumer object is currently registered with this ImageProducer as one of its consumers.

 o removeConsumer
 public synchronized void removeConsumer(ImageConsumer ic)
This method removes the given ImageConsumer object from the list of consumers currently registered to receive image data. It is not considered an error to remove a consumer that is not currently registered. The ImageProducer should stop sending data to this consumer as soon as is feasible.

 o startProduction
 public synchronized void startProduction(ImageConsumer ic)
This method both registers the given ImageConsumer object as a consumer and starts an immediate reconstruction of the image data which will then be delivered to this consumer and any other consumer which may have already been registered with the producer. This method differs from the addConsumer method in that a reproduction of the image data should be triggered as soon as possible.

See Also:
addConsumer
 o requestTopDownLeftRightResend
 public void requestTopDownLeftRightResend(ImageConsumer ic)
This method is used by an ImageConsumer to request that the ImageProducer attempt to resend the image data one more time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in order can be used to produce a better output version of the image. The ImageProducer is free to ignore this call if it cannot resend the data in that order. If the data can be resent, then the ImageProducer should respond by executing the following minimum set of ImageConsumer method calls:
	ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
	ic.setPixels(...);	// As many times as needed
	ic.imageComplete();
 

See Also:
setHints
 o redraw
 public synchronized void redraw(Region invalidRgn) throws QTException
This method is called to redraw the QuickTime image source and update any of the current ImageConsumers with the new pixels that have been generated. This update will only be done if the redrawing flag is true.

Parameters:
invalidRgn - if null the whole image is redrawn and all of the pixels are grabbed and sent to the consumers. If not null then the qtSource invalidates the region specified, which can result in a faster draw. Also only those pixels that are within the bounds of the region are sent to the consumers.
 o updateConsumers
 public synchronized void updateConsumers(Region invalidRgn) throws QTException
This method can be called by an application to have the QTImageProducer to update the pixel data for each of the registered ImageConsumers when the source QTDrawable object has drawn. Thus an application can either explicitly draw the QTDrawable source itself then call this method or can receive notification by the QTDrawable source when it has drawn, and use this method to update the registered ImageConsumers.

Parameters:
invalidRgn - enter null to copy all pixels, or specify a region that specifies the changed pixel data, which can econimize the copying of the pixel data to only those areas that have changed.
 o setRedrawing
 public synchronized void setRedrawing(boolean redrawFlag)
If true then the redraw method of the object will fetch new image data from its image source.

Parameters:
redrawFlag - boolean determining whether the current image is redrawn (false) of fresh or updated image data is first retrieved (true).
 o isRedrawing
 public boolean isRedrawing()
Returns true if the image data may be altered or different upon different calls of the redraw method of the QTDrawable interface

Returns:
s true if redrawing otherwise false if draws exsiting data
 o getSize
 public Dimension getSize()
This returns the rendered size of the qtSource pixel data as specified in the constructor.


All Packages  Class Hierarchy  This Package  Previous  Next  Index